package cn.kai.ymcc.result;

import lombok.Data;

/**
 * @Author Kai
 * @Date 2022/6/5 13:01
 * @PackageName:cn.kai.basic.util
 * @ClassName: AjaxResult
 * @Description: Ajax操作返回结果
 * @Version 1.0
 */

@Data
public class AjaxResult {
    private Boolean success = true;
    private String message = "操作成功！！！";
    //返回操作的额外参数
    private Object resultObj;

    public static AjaxResult me(){
        return new AjaxResult();
    }

    /**
     *  java1.8 链式编程  方便外面调用
     */

    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
